package com.trade.model;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class Contact implements Serializable {
	private static final long serialVersionUID = -1215337731994189534L;
	private Long contactId;
	private String title;
	private String content;
	private int state = STATE_SUBMIT;
	private long total;//合同总价
	private Date contactTime;
	private Date approveTime;
	private User creator;
	private User approver;
	private Customer customer;
	private Set<SaleOrder> saleOrders = new HashSet<SaleOrder>();
	
	public static final int STATE_SUBMIT = 0;//未审核
    public static final int STATE_APPROVE = 1;//审核通过
    public static final int STATE_COMPLETE = 2;//审核未通过
    
    public static final int TOTAL_LIMIT_MANAGER = 1000000;
	
	public Long getContactId() {
		return contactId;
	}
	
	public void setContactId(Long contactId) {
		this.contactId = contactId;
	}
	
	public User getCreator() {
		return creator;
	}
	
	public void setCreator(User creator) {
		this.creator = creator;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getContent() {
		return content;
	}
	
	public void setContent(String content) {
		this.content = content;
	}
	
	public Date getContactTime() {
		return contactTime;
	}

	public Date getApproveTime() {
		return approveTime;
	}

	public void setApproveTime(Date approveTime) {
		this.approveTime = approveTime;
	}

	public User getApprover() {
		return approver;
	}

	public void setApprover(User approver) {
		this.approver = approver;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public void setContactTime(Date contactTime) {
		this.contactTime = contactTime;
	}

	public Set<SaleOrder> getSaleOrders() {
		return saleOrders;
	}

	public void setSaleOrders(Set<SaleOrder> saleOrders) {
		this.saleOrders = saleOrders;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}
	
	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public String getStateDesc() {
		if (this.state == STATE_APPROVE) return "审核通过";
		if (this.state == STATE_COMPLETE) return "审核未通过";
		return "未审核";
	}
}
